<template>
  <transition name="slide">
    <div class="like">
      <div class="header">
        <div class="back" @click="back()">
          <i class="icon-back"></i>
        </div>
        <div class="title">
          {{ title }}
        </div>
      </div>
      <!-- 列表加载 -->
        <rank-list :rankList="likeRank"></rank-list>
      <!-- 数据加载时 -->
      <div class="noDate" v-show="likeRank.length == 0 || likeRank == undefined">
        <img src="@/assets/noDate.png">
      </div>
    </div>
  </transition>
</template>

<script>
import { mapState } from 'vuex'
import RankList from '@/components/rank/RankList'
export default {
  components: {
    RankList
  },
  data () {
    return {
      title: '榜单',
      probeType: 1,
      listenScroll: true
    }
  },
  methods: {
    back () {
      this.$router.back()
    }
  },
  computed: {
    ...mapState(['likeRank'])
  }
}
</script>

<style lang="stylus" scoped>
@import '../../common/stylus/variable'

.slide-enter, .slide-leave-to {
  transform: translateX(100%);
}
.slide-enter-active, .slide-leave-active {
  transition: all 0.5s ease;
}
.like {
  position: fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background-color: $color-background;
  .back {
    position:absolute;
    top: 10px;
    left: 10px;
    font-size: 22px;
    color: $color-theme;
  }
  .title {
    width: 60%;
    line-height: 44px;
    font-size: 18px;
    text-align: center;
    margin: 0 auto;
    color: $color-theme;
  }
  .noDate {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
  }
}
</style>
